import axios from 'axios';

// const BASE_URL = 'https://fairy.ymdx.cn';
const BASE_URL = 'http://127.0.0.1:8615';

export const api = axios.create({
  baseURL: BASE_URL,
  timeout: 5000,
  headers: {
    'Content-Type': 'application/json'
  }
});

export interface CarouselItem {
  id: number;
  name: string;
  detailId: number;
  sort: number;
  thumbnail: string;
  createTime: string;
}

export interface ApiResponse<T> {
  code: number;
  message: string | null;
  data: T;
}

export const getCarouselList = () => {
  return api.post<ApiResponse<CarouselItem[]>>('/v1/fairy/carouselList');
};